<?php echo $header; ?>
<div id="content">
   <div class="breadcrumb">
    <?php echo $this->breadCrumbs(); ?>
  </div>
  <?php if (isset($error_warning)) { ?>
  <div class="warning"><?php echo $error_warning; ?></div>
  <?php } ?>
  <?php if ($success) { ?>
  <div class="success"><?php echo $success; ?></div>
  <?php } ?>
  <div class="box">
    <div class="heading">
      <h1><img src="view/image/category.png" alt="" /><?php echo $_['heading_title'];?></h1>
      <div class="buttons"><a onclick="location = '<?php echo UA('article/category/insert'); ?>'" class="button"><span><?php echo $_['button_insert']; ?></span></a><a onclick="$('#form').submit();" class="button"><span><?php echo $_['button_delete']; ?></span></a></div>
    </div>
    <div class="content">
      <form action="<?php echo UA('article/category/delete'); ?>" method="post" enctype="multipart/form-data" id="form">
        <table class="list" data-acturi="<?php echo UA('article/category/smartedit');?>">
          <thead>
            <tr height="30">
              <td width="1" style="text-align: center;"><input type="checkbox" onclick="$('input[name*=\'selected\']').attr('checked', this.checked);" /></td>
              <td width="50">ID</td>
			  <td><?php echo $_['text_name']; ?></td>
			  <td width="120"><?php echo $_['text_sort_order'];?></td>
			  <td width="100"><?php echo $_['text_action'];?></td>
            </tr>
          </thead>
          <tbody>
            <?php if ($categories) { ?>
            <?php foreach ($categories as $category) { ?>
            <tr  height="30" onmouseover="this.className='on';" onmouseout="this.className='';">
              <td style="text-align: center;">
                <input type="checkbox" name="selected[]" value="<?php echo $category['category_id']; ?>" /></td>
			  <td><?php echo $category['category_id']; ?></td>
			  <td><a href="<?php echo U('article/category', 'category_id=' . $category['category_id']);?>" target="_blank"><?php echo $category['name']; ?></a></td>
			  <td><?php echo $category['sort_order']; ?></td>
			  <td>				
				[<a href="<?php echo UA('article/category/update'); ?>&category_id=<?php echo $category['category_id']?>"><?php echo $_['text_edit']; ?></a>]
			  </td>
            </tr>
            <?php } ?>
            <?php } else { ?>
            <tr>
              <td class="center" colspan="15"><?php echo $_['text_no_results']; ?></td>
            </tr>
            <?php } ?>
          </tbody>
        </table>
      </form>
    </div>
  </div>
</div>
<?php echo $footer; ?>